package com.comall.dc.banktest.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 转账记录
 * </p>
 *
 * @author GodMeowIceSun
 * @since 2021-11-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("account_record")
@ApiModel(value = "AccountRecord对象", description = "转账记录")
public class AccountRecordPO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "账户操作(0:存款, 1:取款, 2:转账)")
    private Integer operation;

    @ApiModelProperty(value = "来源账户ID")
    @TableField("from_account_id")
    private Integer fromAccountId;

    @ApiModelProperty(value = "目的账户ID, 可能为空")
    @TableField("to_account_id")
    private Integer toAccountId;

    @ApiModelProperty(value = "操作金额")
    private BigDecimal value;

    @ApiModelProperty(value = "创建时间, 操作时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


}
